<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>#{tekster.Red_oppg}</title>
            </f:facet>
        </h:head>
        <h:form>
            <h:body>
                <ui:composition template="../templates/template.xhtml">
                    <ui:define name="content">
                        <p:growl id="growl" globalOnly="true" sticky="false"/>
                        <h:outputText value="Du har valgt oppgave #{reg.oppg} i oppgavesett #{reg.os.nivaa} for operator #{reg.getOperator()}"/>
                        <h3>#{tekster.Red_nyTekst}</h3>

                        <p:inputTextarea value="#{reg.oppgTekst}" rows="5" cols="50" maxlength="100"/> 
                        <br/>
                        <br/>
                        <h3>#{tekster.OO_svar}</h3>   

                        <p:inputText id ="svar" type="number" converterMessage=" Skriv inn tall" required="true" maxlength="7" value="#{reg.svar}">
                            <f:convertNumber integerOnly="true" > </f:convertNumber>
                        </p:inputText>
                        <h:message for="svar" style="color: red;"></h:message>
                        <p:commandButton update="growl" ajax="false" value="Sjekk svar" actionListener="#{reg.regneRegne(ev)}"/>

                        <br/>
                        <br/>
                        <h3>#{tekster.Red_hint}</h3>
                        <p:inputTextarea value="#{reg.hint}" rows="5" cols="50"/>
                        <br/>
                        <br/>
                        <p:commandButton actionListener="#{reg.setOppgEndreGrowl(e)}" ajax ="false" value="#{tekster.OO_fullf}"/>

                    </ui:define>
                    <ui:define name="left">
                        <div align="center">
                            <h:commandLink action="/index?faces-redirect=true" immediate="true">
                                <h:graphicImage library="images" name="home.png"/>
                            </h:commandLink><br/><br/>
                            <p:commandButton ajax="false" action="/Ansatt/ansatt?faces-redirect=true" value="#{tekster.Tilbake_ansatt}" immediate="true" />
                        </div>
                    </ui:define>
                </ui:composition>
            </h:body>
        </h:form>
    </f:view>
</html>
